<extend name="template/base_index" />

<block name="area_header">

    <link rel="stylesheet" href="__CSS__/style.css">
</block>

<block name="area_body">
    <div class="weui_search_bar" id="search_bar">
        <form class="weui_search_outer" action="{:U('index/index')}" method="post">
            <div class="weui_search_inner">
                <i class="weui_icon_search"></i>
                <input type="text" class="weui_search_input" id="search_input" placeholder="搜索" name="name" required/>
                <a href="javascript:" class="weui_icon_clear" id="search_clear"></a>
            </div>
            <label for="search_input" class="weui_search_text" id="search_text">
                <i class="weui_icon_search"></i>
                <span>搜索</span>
            </label>
        </form>
        <a href="javascript:" class="weui_search_cancel" id="search_cancel">取消</a>
    </div>

    <div class="img-content">
        <div class="swiper-container">
            <div class="swiper-wrapper">
                <volist name="banners" id="banner">
                    <div class="swiper-slide"><a href="{$banner['url']}"><img src="{$banner['img']}" width="100%"/></a></div>
                </volist>
            </div>
                <div class="swiper-pagination"></div>
        </div>

    </div>
    <div class="main-content" id="content">
        <volist name="product" id = 'vo'>
            <div class="good-content">

                <a class="good-main" href="{:U('group/good_index',array('id' => $vo['id']))}">
                    <div class="swiper-slide" style="position:relative;">
                        <img src="http://muyin.8raw.com/api.php/picture/index?id={$vo['imglist']}" width="100%"/>
                        <div style="position:absolute; z-index:2; left:10px; bottom:10px">已参团：{$vo['attend_sum']}人</div>
                    </div>
                    <div class="good-mtop"><h3>{$vo['name']}</h3></div>
                    <!--<div class="good-intr"><p>{$vo['synopsis']}</div>-->
                    <!--<br><span>原价：{$vo['ori_price']}</span><br><span class="quantity">库存:{$vo['quantity']}</span> 开始时间：{$vo['start_time']}</span><br>-->
                    <div>
                    <div class="good-mtop" style="float:left">
                       <span><img src="__IMG__/pintuan.png" width="20px" height="20px">{$vo['group_sum']}人团</span></div>
                       <!--<div class="good-price" style="float:left"><i class="fa fa-jpy"></i></div>-->
                        <div style="background-color:#ff4e68; width: 150px; height: 40px;float:right;border-radius: 5px;">

                            <h2 style="color:white">&nbsp&nbsp去拼团<img src="__IMG__/jiantouyou.png" width="20px" height="20px"></h2></div>
                    </div>
            </br>

                </a>
            </div>
        </volist>
    </div>
    <div class="footermenu">
        <ul>
            <li><center><a href="{:U('Home/Index/index')}"><img src="__IMG__/indeximg.png" width="25px" height="25px"><p>首页</p></a></center></li>
            <li><center><a href="{:U('Home/Ps/index')}"><img src="__IMG__/zhongchou.png" width="25px" height="25px"><p>育儿知识</p></a></center></li>
            <li><center><a href="{:U('Home/User/add_good')}" class="add_good"><img src="__IMG__/addgood.png" width="20px" height="20px"><p>发布</p></a></center></li>
            <li><center><a href="{:U('Home/Group/index')}"><img src="__IMG__/pintuan.png" width="25px" height="25px"><p>拼团</p></a></center></li>
            <li><center><a href="{:U('Home/UserCenter/index')}"><img src="__IMG__/userimg.png" width="25px" height="25px"><p>个人中心</p></a></center></li>

        </ul>
    </div>
    <!--隐藏的页码-->
    <input type="hidden" value="1" id="page"/>
    <input type="hidden" value="{$name}" id="name">
    <input type="hidden" value="{$pid}" id="pid"><!--分类隐藏-->
    <div class="weui-infinite-scroll">
        <div class="infinite-preloader"></div><!-- 菊花 -->
        正在加载... <!-- 文案，可以自行修改 -->
    </div>
    <script src="__JS__/jquery-weui.min.js"></script>
    <script type='text/javascript' src='__JS__/swiper.js' charset='utf-8'></script>
    <script>
        $(".swiper-container").swiper({
            loop: true,
            autoplay: 3000
        });
        $(function() {
            $(document.body).infinite(100);
            var loading = false;
            $(document.body).infinite().on("infinite", function () {
                $('.weui-infinite-scroll').css('display','block');
                if (loading) return;
                loading = true;
                setTimeout(function () {
                    var page = parseInt($("#page").val()) + 1;
                    var like = $('#name').val();
                    var pid = $('#pid').val();
                    $.get("{:U('group/index')}",{curpage:page,name:like,pid:pid}, function(result){
                       if(result){
                           $("#content").append(result);
                           $('#page').val(page);
                       }else{
                           $('.weui-infinite-scroll').html("<span class='lastfinally'>没了 等您来发布哦</span>");
                       }
                        loading = false;
                    });   //模拟延迟
                }, 1500);
            });
        })
    </script>
</block>
<!---->